package com.weaver.drools.business.execution.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.weaver.drools.business.execution.service.IEAqInsReview125Service;
import com.weaver.drools.common.dao.EAqInsReview125Dao;
import com.weaver.drools.common.entity.EAqInsReview125;
@Service
public class EAqInsReview125ServiceImpl implements IEAqInsReview125Service {

	@Autowired
	private EAqInsReview125Dao insReview125Dao;
	
	@Override
	public EAqInsReview125 findById(Long reviewid) {
		// TODO Auto-generated method stub
		return insReview125Dao.findEAqInsReview125ByReviewid(reviewid);
	}

	@Override
	public void saveDWrit100(EAqInsReview125 insReview125) {
		insReview125Dao.saveOrUpdate(insReview125);
	}

	@Override
	public void updateDWrit100(EAqInsReview125 insReview125) {
		insReview125Dao.saveOrUpdate(insReview125);
	}

	@Override
	public void deleteById(Long reviewid) {
		insReview125Dao.deleteById(reviewid);
	}

	@Override
	public List<EAqInsReview125> findListByInpectionPandectId(Long inpectionPandectId) throws Exception {
		String hql="from EAqInsReview125 where isdeleted=0";
		if(inpectionPandectId!=null && !inpectionPandectId.equals("")){
			hql+=" and EAqInsInpectionpandect599.inpectionpandectid="+inpectionPandectId;
		}
		hql+=" order by reviewid desc";
		return (List<EAqInsReview125>)insReview125Dao.findListByhql(hql);
	}

}
